package com.icexxx.prime;

import java.math.BigInteger;

public class Main7 {

    public static void main(String[] args) {
        int n = 100000000;
        long t1 = System.currentTimeMillis();
        int count = 0;
        for (int i = 2; i < n; i++) {
            if (isPrime(i)) {
                count++;
            }
        }
        long t2 = System.currentTimeMillis();
        System.out.println("count=" + count);
        System.out.println("time=" + (t2 - t1));
    }

    private static boolean isPrime(int num) {
        BigInteger bigInteger = new BigInteger(num + "");
        return bigInteger.isProbablePrime(7);
    }

}
//count=664581
//time=17082
//certainty=5

//count=664579
//time=17113
//certainty=6

//count=664579
//time=18736
//certainty=7

//count=5761455
//time=197450
//certainty=7
